
/* 
	检查全屏状态
 */
function checkIsFullScreen() {
	return !!(document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.webkitFullScreen || document.msFullScreen);
}
	
/* 
	检查能否全屏
 */
function checkIsFullscreenEnabled() {
	return document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled;
}

/* 
	获取当前全屏元素
 */
function getFullscreenElement() {
	return document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement;
}

/* 
	指定元素进入全屏
 */
function requestFullscreen(element) {
	if (element.requestFullscreen) {
	  element.requestFullscreen();
	} else if (element.mozRequestFullScreen) {
	  element.mozRequestFullScreen();
	} else if (element.msRequestFullscreen) {
	  element.msRequestFullscreen();
	} else if (element.webkitRequestFullscreen) {
	  element.webkitRequestFullScreen();
	} else {
		return false;
	}
	return true;
}

/* 
	退出全屏
 */
function exitFullscreen() {
	if (document.exitFullscreen) {
	  document.exitFullscreen();
	} else if (document.msExitFullscreen) {
	  document.msExitFullscreen();
	} else if (document.mozCancelFullScreen) {
	  document.mozCancelFullScreen();
	} else if (document.webkitExitFullscreen) {
	  document.webkitExitFullscreen();
	} else {
		return false;
	}
	return true;
}

export {
	checkIsFullScreen, checkIsFullscreenEnabled, getFullscreenElement,
	requestFullscreen, exitFullscreen
}